/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package br.com.loja.model.entity.conta;

import br.com.loja.model.entity.Switchable;
import br.com.loja.view.swing.Composition;
import br.com.loja.view.swing.model.FormField;
import br.com.loja.view.swing.model.IgnoreTableModel;
import java.io.Serializable;
import java.math.BigDecimal;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

/**
 *
 * @author David Luiz
 */
@Entity
@Table(name = "operacao")
@Composition(Conta.class)
public class Operacao implements Switchable, Serializable {

    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private Long idOperacao;
    private String historico;
    private BigDecimal valor;
    @ManyToOne
    @FormField(visible = false)
    @IgnoreTableModel
    private Conta conta;

    @FormField(visible = false)
    @IgnoreTableModel
    private boolean dead;

    public Operacao() {
    }

    /**
     * @return the idOperacao
     */
    public Long getIdOperacao() {
        return idOperacao;
    }

    /**
     * @param idOperacao the idOperacao to set
     */
    public void setIdOperacao(Long idOperacao) {
        this.idOperacao = idOperacao;
    }

    /**
     * @return the historico
     */
    public String getHistorico() {
        return historico;
    }

    /**
     * @param historico the historico to set
     */
    public void setHistorico(String historico) {
        this.historico = historico;
    }

    /**
     * @return the valor
     */
    public BigDecimal getValor() {
        return valor;
    }

    /**
     * @param valor the valor to set
     */
    public void setValor(BigDecimal valor) {
        this.valor = valor;
    }

    /**
     * @return the conta
     */
    public Conta getConta() {
        return conta;
    }

    /**
     * @param conta the conta to set
     */
    public void setConta(Conta conta) {
        this.conta = conta;
    }

    @Override
    public boolean isDead() {
        return dead;
    }

    @Override
    public void setDead(boolean dead) {
        this.dead = dead;
    }

}
